import java.math.BigInteger;
public class Factorial {
    public static void main(String[] args) {
        //for循环
        BigInteger temp = BigInteger.ONE,ans = BigInteger.ZERO,i = BigInteger.ONE,hundred = new BigInteger("100");
        for (; i.compareTo(hundred) <= 0; i = i.add(BigInteger.ONE)) {
            temp = temp.multiply(i);
            ans = ans.add(temp);
        }
        System.out.println(ans);

        //while循环
        temp = BigInteger.ONE;
        ans = BigInteger.ZERO;
        i = BigInteger.ONE;
        while (i.compareTo(hundred) <= 0) {
            temp = temp.multiply(i);
            ans = ans.add(temp);
            i = i.add(BigInteger.ONE);
        }
        System.out.println(ans);

        //do while循环
        temp = BigInteger.ONE;
        ans = BigInteger.ZERO;
        i = BigInteger.ONE;
        do {
            temp = temp.multiply(i);
            ans = ans.add(temp);
            i = i.add(BigInteger.ONE);
        }while(i.compareTo(hundred) <= 0);
        System.out.println(ans);
    }
}